package com.centaline.androidsalesblog.application;

import android.support.v4.util.ArrayMap;

import com.centaline.androidsalesblog.constants.AppConstant;

/**
 * http请求headers
 * Created by guilin on 15/12/17.
 */
public final class Header {

    private static final ArrayMap<String, String> ARRAY_MAP = new ArrayMap<>();

    private Header() {
        // Utility class.
    }


    public static ArrayMap<String, String> getHeaders() {
        if (ARRAY_MAP.isEmpty()) {
            ARRAY_MAP.put("Accept-Encoding", "gzip");
            ARRAY_MAP.put("platform", "android");
        }
        ARRAY_MAP.put("CityCode", AppConstant.CityCode);
        return ARRAY_MAP;
    }

    public static void putHeader(String key, String value) {
        ARRAY_MAP.put(key, value);
    }
}
